//
//  KABUserAgreementVC.m
//  kabu
//
//  Created by XiangDongMBP on 2017/2/12.
//  Copyright © 2017年 East. All rights reserved.
//

#import "KABUserAgreementVC.h"
#import <WebKit/WebKit.h>

@interface KABUserAgreementVC ()
@property (nonatomic, strong) WKWebView *webView;
//@property (weak, nonatomic) IBOutlet UIWebView *uiWebView;

@end

@implementation KABUserAgreementVC

#pragma mark - life cycle
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self initNavigationBar];
    [self initSubViews];
}

- (void)initNavigationBar {
    self.navigationItem.title = @"用户协议";
}

- (void)initSubViews {
    [self.view addSubview:self.webView];
    
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Kabu使用协议" ofType:@"docx"];
    NSURL *url = [NSURL fileURLWithPath:path];
//    [self.webView loadFileURL:url allowingReadAccessToURL:YES];
    [self.webView loadRequest:[NSURLRequest requestWithURL:url]];
//    [self.uiWebView loadRequest:[NSURLRequest requestWithURL:url]];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - delegate
#pragma mark - event response
#pragma mark - private methods
#pragma mark - network request
#pragma mark - getters and setters
- (WKWebView *)webView {
    if (!_webView) {
        _webView = [[WKWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    }
    return _webView;
}

@end
